import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2023-03-20
 * Time: 20:36
 */
//删除公共字符正确版本

public class TestDemo {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        String s1=in.nextLine();
        String s2=in.nextLine();
        Set<Character> set=new HashSet<>();
        StringBuffer stringBuffer=new StringBuffer();//拼接字符串
        for(int i=0;i<s2.length();i++) {
            char ch = s2.charAt(i);
            set.add(ch);
        }
            for(int j=0;j<s1.length();j++){
                char ch1=s1.charAt(j);
                if(!set.contains(ch1)){
                    stringBuffer.append(ch1);
                }
            }

        System.out.println(stringBuffer);
    }
}
